package net.dengzixu.java.homework.period17.homework1;

public class TeacherTest {
    public static void main(String[] args) {
        Teacher teacher = new Teacher("教师A", "C# 基础教程", 96);
        System.out.println("课时当量: " + teacher.courseCompute());
        System.out.println("课时费: " + teacher.moneyCompute());
    }
}

class Teacher {
    private String name;
    private String course;
    private double courseNum;
    private final double radio = 1.0;

    /**
     * 教师
     *
     * @param name      姓名
     * @param course    所授课程
     * @param courseNum 课时数量
     */
    public Teacher(String name, String course, double courseNum) {
        this.name = name;
        this.course = course;
        this.courseNum = courseNum;
    }

    /**
     * 计算课时当量
     *
     * @return 课时当量
     */
    public double courseCompute() {
        return courseNum * radio;
    }

    /**
     * 计算课时费
     *
     * @return 课时费
     */
    public double moneyCompute() {
        return courseCompute() * (courseCompute() < 100 ? 20 : 30);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCourse() {
        return course;
    }

    public void setCourse(String course) {
        this.course = course;
    }

    public double getCourseNum() {
        return courseNum;
    }

    public void setCourseNum(double courseNum) {
        this.courseNum = courseNum;
    }

    public double getRadio() {
        return radio;
    }
}
